import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import vuetify from './plugins/vuetify';
import * as filters from '@/assets/js/common_filters.js';
import * as functions from '@/assets/js/common_functions.js'
import  api from '@/utils/api.js';
var _lodash = require("lodash");

//绑定全局方法
Vue.prototype.$functions = functions;

//绑定全局请求
Vue.prototype.$http = api;

//注册全局组件
var requireComponent = require.context(
    "@/components/j-components",
    false,
    /j-[\w-]+\.vue$/
);
requireComponent.keys().forEach(fileName => {
  var componentConfig = requireComponent(fileName);
  var componentName = _lodash.upperFirst(
      _lodash.camelCase(
          fileName
              .replace(/^\.\//, "")
              .replace(/\.\w+$/, "")
      )
  );
  Vue.component(componentName, componentConfig.default || componentConfig);
});
//注册全局过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});



Vue.config.productionTip = false;

new Vue({
  router,
  store,
  vuetify,
  render: h => h(App)
}).$mount('#app')
